$(function() {
    $(".del").click(function() {
        var url = $(this).attr('val');
        bootbox.confirm({
            title: "系统提示",
            message: "是否要删除该用户?",
            callback: function(result) {
                if (result) {
                    window.location.href = url;
                }
            },
            buttons: {
                "cancel": {
                    "label": "取消"
                },
                "confirm": {
                    "label": "确定",
                    "className": "btn-danger"
                }
            }
        });
    });

    //download
    $("#download-users").on('click', function(event){
    	event.preventDefault();
    	var $form = $("#form-search");

    	// console.log($form.serialize())
    	window.open($(this).data('url')+'?'+$form.serialize());
    	return false;

    	// $form.attr("method",'POST');
    	// $form.attr("action", $(this).data('url'));
    	// $form.submit();
    });
})